package com.ltba.rf.control.thread;

public class RealTimeData {
	
	private String udpateTime;
	private String origin;
	private String maxDegree;
	
	public String getUdpateTime() {
		return udpateTime;
	}
	public void setUdpateTime(String udpateTime) {
		this.udpateTime = udpateTime;
	}
	public String getOrigin() {
		return origin;
	}
	public void setOrigin(String origin) {
		this.origin = origin;
	}
	public String getMaxDegree() {
		return maxDegree;
	}
	public void setMaxDegree(String maxDegree) {
		this.maxDegree = maxDegree;
	}
	
	public boolean isIndexMorethanMax(int index) {
		boolean isUpper = false;
		String tmp = maxDegree.replace("震度", "");
		if(tmp.contains("超")) {
			isUpper = true;
			tmp = tmp.replace("超", "");
		}
		tmp = tmp.replace("弱", "");
		int max = Integer.valueOf(tmp);
		
		if(isUpper && index == max) {
			return false;
		}		
		
		return index >= max;	
	}
	
	public RealTimeData(String udpateTime, String origin, String maxDegree) {
		super();
		this.udpateTime = udpateTime;
		this.origin = origin;
		this.maxDegree = maxDegree;
	}
	public String getKey() {
		StringBuilder sb = new StringBuilder();
		sb.append(this.udpateTime).append(origin).append(maxDegree);
		return sb.toString();
	}
}
